#include <bits/stdc++.h>

using namespace std;

//将奇数放到偶数之前？
//快速排序之分割
class Solution1 {
public:
    void partion(vector<int>& nums){
        if(nums.size()==0) return ;
        int l=0,r=nums.size()-1,k=nums[l];
        while(l<r){
            while(l<r&&!(nums[r]&1)) r--;
            nums[l]=nums[r];
            while(l<r&&(nums[l]&1))l++;
            nums[r]=nums[l];
        }
        nums[l]=k;
    }
    vector<int> exchange(vector<int>& nums) {
        partion(nums);
        
        return nums;
    }
};
class Solution2 {
public:
    vector<int> exchange(vector<int>& nums) {
        int l=0,r=0,len=nums.size();
        while(r<len){
            if(nums[r]&1){
                swap(nums[l],nums[r]);
                l++;
            }
            r++;
        }
        
        return nums;
    }
};

class Solution {
public:
    vector<int> exchange(vector<int>& nums) {
        vector<int> v1,v2;
        int len=nums.size();
        for(int i=0;i<len;i++){
            if(nums[i]&1){
                v1.push_back(nums[i]);
            }else{
                v2.push_back(nums[i]);
            }
        }
        v1.insert(v1.end(),v2.begin(),v2.end());
        return v1;
    }
};


int main(){




    return 0;
}